# Maintainer: Johannes Löthberg <johannes@kyriasis.com>
# Contributor: Piotr Rogoża <piotr dot r dot public at gmail dot com>

pkgname=perl-test-without-module
pkgver=0.21
pkgrel=2

pkgdesc='Test::Without::Module - Test fallback behaviour in absence of modules'
url="https://search.cpan.org/dist/Test-Without-Module/"
arch=('any')
license=('GPL' 'PerlArtistic')

depends=('perl')
makedepends=('perl')
checkdepends=('perl-file-slurp')

source=("https://search.cpan.org/CPAN/authors/id/C/CO/CORION/Test-Without-Module-$pkgver.tar.gz")

sha256sums=('3cdeafadac4853ebeafe689346d555da5dfa3cfa9d4c84e3e5e7bfee50beec46')

options=(!emptydirs)

build() {
	cd Test-Without-Module-"$pkgver"

	# Setting these env variables overwrites any command-line-options we don't want...
	export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps \
	       PERL_MM_OPT="" PERL_MB_OPT="" MODULEBUILDRC=/dev/null

	perl Makefile.PL INSTALLDIRS=vendor
	make
}

check() {
	cd Test-Without-Module-"$pkgver"
	make test
}

package() {
	cd Test-Without-Module-"$pkgver"
	make install DESTDIR="$pkgdir"
	find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}
